package com.yuanfeng.order.controller;

import com.yuanfeng.commoms.util.ResponseResult;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * @ClassName OrderSupplierCreateController
 * @Description 供应商 创建订单 计算价格
 * @Author cyp
 * @Date 2023/7/14 15:23
 * @Version 1.0
 **/
@RestController
@CrossOrigin
@RequestMapping("supply")
public class OrderSupplierCreateController extends BaseController {


    /**
     * 供应商 计算价格
     * @param message
     * @return
     */
    @RequestMapping("calculatePrice")
    public ResponseResult calculatePrice(@RequestBody String message){
        ResponseResult result = orderSupplierCreateServer.calculatePrice(message);
        return result;
    }

    /**
     * 供应商 下单
     * @param message
     * @param request
     * @return
     */
    @RequestMapping("createOrders")
    public ResponseResult createOrders(@RequestBody String message, HttpServletRequest request){
        ResponseResult orders = orderSupplierCreateServer.createOrders(message, request);
        return orders;
    }


}
